package com.chenyun.boot.datasource.extension;

import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
import com.chenyun.common.utils.YidUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 自定义id生成器
 * @author Lonni
 * @date 2022-07-02 20:31
 */
@Component
@Slf4j
public class CustomIdGenerator implements IdentifierGenerator {
    @Override
    public Number nextId(Object entity) {
        log.debug("进入自定义id生成器...");
        return YidUtil.me.nextId();
    }


}
